﻿using System;
using System.Collections.Generic;
using System.Text;
using SecurityDAL;
using System.Data;
using MyExection;

namespace SecurityBLL
{
    public class LoginBLL
    {
        private LoginDAL loginDAL = null;
        public LoginBLL()
        {
            loginDAL = new LoginDAL();
        }

        /// <summary>
        /// 用户登陆
        /// </summary>
        /// <param name="name"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public DataSet YongHuDengLu(string name, string password)
        {
            try
            {
                return loginDAL.YongHuDengLu(name, password);
            }
            catch (CustomException)
            {
                throw new CustomException("用户登陆出错，请重试！");
            }
        }


         /// <summary>
        /// 查询数据的年份信息，用于绑定所有的年份下拉列表
        /// </summary>
        /// <returns></returns>
        public DataTable GetNianFenTable()
        {

            try
            {
                return loginDAL.GetNianFenTable();
            }
            catch (CustomException)
            {
                throw new CustomException("您分信息初始化失败，请重试");
            }
        }
    }
}
